<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #app{
            position: relative;
            width: 300px;
            height: 300px;
            border: 1px solid;
        }

       /*
        left 默认值: auto
        right 默认值: auto
        top 默认值: auto
        bottom 默认值: auto

        margin默认值 : 0
        border默认值 : 0
        padding默认值 : 0
        width默认值 : auto

        一个绝对定位的元素
         横向上:  left + right + margin + border + padding + width = 包含块padding-box的width
         纵向上:  top  + bottom + margin + border + padding + height = 包含块padding-box的height

       */



        #test{
            width: 100px;
            height: 100px;
            background: pink;

            position: absolute;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            margin: auto;
        }
    </style>
</head>
<body>
    <div id="app">
        <div id="test">

        </div>
    </div>
</body>
</html>